﻿@model SettingModeModel

<div class="form-group row">
    <div class="col-md-12">
        <div class="onoffswitch">
            <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="advanced-settings-mode" checked="@Model.Enabled">
            <label class="onoffswitch-label" for="advanced-settings-mode">
                <span class="onoffswitch-inner" 
                      data-locale-basic="@T("Admin.Configuration.Settings.Mode.Basic")" 
                      data-locale-advanced="@T("Admin.Configuration.Settings.Mode.Advanced")"></span>
                <span class="onoffswitch-switch"></span>
            </label>
        </div>
        <script>
            function checkAdvancedSettingsMode(advanced) {
                if (advanced) {
                    $("body").addClass("advanced-settings-mode");
                    $("body").removeClass("basic-settings-mode");
                } else {
                    $("body").removeClass("advanced-settings-mode");
                    $("body").addClass("basic-settings-mode");
                }
            }
            checkAdvancedSettingsMode($("#advanced-settings-mode").is(':checked'));
            $(document).ready(function() {
                $("#advanced-settings-mode").click(function() {
                    checkAdvancedSettingsMode($(this).is(':checked'));
                    saveUserPreferences('@(Url.Action("SavePreference", "Preferences"))', '@Model.ModeName', $(this).is(':checked'));
                    ensureDataTablesRendered();
                });
            });
        </script>
    </div>
</div>


